//
//  BuildingTableViewCell.m
//  Utils
//
//  Created by enghou on 2018/4/28.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "BuildingTableViewCell.h"

@implementation BuildingTableViewCell

-(void)setModel:(BuildingItemModel *)model{
    _model = model;
    self.titleLabel.text = [NSString stringWithFormat:@"楼与名称: %@",_model.name];
    self.dateLabel.text = _model.date;
    self.addressLabel.text = [NSString stringWithFormat:@"楼宇地址: %@",_model.address];
    if (self.model.needLayout) {
        [self.BTN setTitle:@"生成布局" forState:UIControlStateNormal];
    }else{
        [self.BTN setTitle:@"绑定楼宇" forState:UIControlStateNormal];
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)bindingBuildings:(id)sender {
    if (self.model.needLayout) {
        [[NSNotificationCenter defaultCenter]postNotificationName:@"GenerateLayout" object:self.model];
    }else{
        [[NSNotificationCenter defaultCenter]postNotificationName:@"BindBuilding" object:self.model];
    }
}
@end
